﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using System.Data;

namespace PepsiCo.Common.Entities
{
    public class ContactInformationItem : T2V.SharePoint.Common.Entities.BaseEntity
    {
        public ContactInformationItem(SPListItem item)
            : base(item)
        {
            //get image url from ImageField
            if (item["Thumbnail1"] != null && !string.IsNullOrEmpty(item["Thumbnail1"].ToString()))
            {
                Thumbnail = item["Thumbnail1"].ToString().Split(new string[] { ";#" }, StringSplitOptions.None)[1];
            }
        }

        public ContactInformationItem(DataRow item)
            : base(item)
        {
            if (item["Thumbnail1"] != null && !string.IsNullOrEmpty(item["Thumbnail1"].ToString()))
            {
                Thumbnail = item["Thumbnail1"].ToString().Split(new string[] { ";#" }, StringSplitOptions.None)[1];
            }
        }

        public string Thumbnail { get; set; }
        public string Thumbnail1 { get; set; }
        public string PhoneNumber { get; set; }
        public string JobTitle { get; set; }
        public string ShortDescription { get; set; }
        public bool IsActive { get; set; }
    }
}
